package string;

/**
 * boolean startsWith(String str)   判断字符串是否以str开始
 * boolean endsWith(String str)     判断字符串是否以str结束
 */
public class StartWithDemo {
    public static void main(String[] args) {
        String line = "www.tedu.cn";
        boolean starts =line.startsWith("www");
        System.out.println("starts:"+starts);
        boolean ends = line.endsWith("cn");
        System.out.println("ends:"+ends);
    }
}
